<%@page language="java" pageEncoding="utf-8" %>
<%@page import="cn.com.wxd.common.DateUtil" %>
<%@page import="cn.com.wxd.util.user.UserCoreUtil" %>
<%@page import="cn.com.wxd.util.service.ProjectInfo" %>
<%@page import="cn.com.wxd.entity.user.UsersInfo" %>
<%@page import="cn.com.wxd.util.service.WebUtil" %>
<%@page import="cn.com.wxd.service.weather.Weatherbean" %>
<%@ page import="cn.com.wxd.entity.user.AccountInfo" %>
<%
    String path = request.getContextPath();
    String basePath =
            request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";

    AccountInfo accountInfo = UserCoreUtil.getLoginAccount(request);
    UsersInfo userinfo = null;
    if(accountInfo != null){
        userinfo = accountInfo.getUsersInfo();
    }
    Weatherbean weatherBean = WebUtil.getWeather(request);
    String tianqi = "";
    if (weatherBean != null) {
        tianqi = weatherBean.getCityName() + "&nbsp;" + weatherBean.getStateDetailed()
                + "&nbsp;" + weatherBean.getTem2() + "℃ ~ "
                + weatherBean.getTem1() + "℃";
    }
%>

<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath %>">
    <title><%=ProjectInfo.getCompanyName() %>后台管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <!-- 强制浏览器使用最新的内核，解决了bootstrap在IE兼容模式下无法使用的问题 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
    <meta name="description" content="">
    <meta name="ROBOTS" content="NOARCHIVE"/>
    <meta name="author" content="王旭东">
    <link rel="shortcut icon" href="favicon.ico"/>
    <link rel="stylesheet" type="text/css" href="static/admin/lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="static/admin/css/theme.css">
    <link rel="stylesheet" type="text/css" href="static/admin/lib/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="static/util/plugins/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="static/admin/css/main.css">

    <script type="text/javascript" src="static/js/jquery1-11-3.min.js"></script>
    <script type="text/javascript" src="static/admin/lib/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="static/admin/js/bootstrap-closable-tab.js"></script>
    <script type="text/javascript" src="static/util/plugins/layui/layui.js"></script>
    <script type="text/javascript" src="static/admin/js/main.js"></script>
    <script type="text/javascript">
        var okSpan = "";
        var parentLayer;
        $(function () {
            //加载layui.layer弹出层组件
            layui.use('layer', function () {
                parentLayer = layui.layer;
            });
            //初始化页面的高度
            setPageHeight();
            window.onresize = function () {
                setPageHeight();
            };
            okSpan = document.createElement("span");
            okSpan.setAttribute("id", "selectOK");

            //默认页面
            yourajax("");

            //给元素加上beating类属性，则可以跳动
            setInterval("beating()", 3000);//1000为1秒钟
        });
    </script>
</head>
<body>
<div class="navbar">
    <div class="navbar-inner">
        <ul class="nav pull-right">
            <li style="height:42px;">
                <a class="beating" href="#" style="height: 20px;margin-top: 2px;">
                    <span class="icon-envelope icon-large pull-left"></span>
                    <span class="badge pull-left">0</span>
                </a>
            </li>
            <li style="height:42px;">
                <a href="userspage/modifyuserinfo.jsp"
                   id="headImgspan" target="_black">
                    <img class="indexuserhead"
                         src="<%=WebUtil.getUserHeadImg(request) %>"
                         onerror="javascript:this.src='static/images/defaultHeadImg.png';"/>
                </a>
            </li>
            <li id="fat-menu" class="dropdown">
                <a href="#" role="button" class="dropdown-toggle userdropdown" data-toggle="dropdown">
                    <%=userinfo.getNickName()%>
                    <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1"
                           href="userspage/modifyuserinfo.jsp" target="_blank">我的资料</a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a tabindex="-1" href="user/logout">注销</a>
                    </li>
                </ul>
            </li>
        </ul>
        <a class="brand" href="#"><span class="first"><%=ProjectInfo.getCompanyName()%></span>
            <span class="second">后台管理系统</span>
        </a>
    </div>
</div>

<div>
    <!-- 隐藏导航 -->
    <a id="hiddennav" href="javascript:shouqi()"
       style="background-image:url(static/admin/images/jiantou-hui-min.png);"></a>
    <div class="sidebar-nav">
        <div class="sidebar-menu">
            <a href="#websiteMenu" class="nav-header menu-first collapsed" data-toggle="collapse">
                <i class="fa fa-fw fa-globe fa-lg" title="网站管理">
                </i><span class="menu-text">网站管理</span>
            </a>
            <ul id="websiteMenu" class="nav nav-list collapse menu-second in">
                <li><a id="websiteInfo" href="javascript:selectOk('websiteInfo')">
                    <i class="fa fa-fw fa-info" title="网站信息"></i>
                    <span class="menu-text">网站信息</span></a>
                </li>
                <li><a id="articleList" href="javascript:selectOk('articleList')">
                    <i class="fa fa-fw fa-pencil-square-o" title="文章管理"></i>
                    <span class="menu-text">文章管理</span></a></li>
                <li><a id="catalogList" href="javascript:selectOk('catalogList')">
                    <i class="fa fa-fw fa-th" title="栏目管理"></i>
                    <span class="menu-text">栏目管理</span></a>
                </li>
                <li><a id="commentList" href="javascript:selectOk('commentList')">
                    <i class="fa fa-fw fa-comment" title="评论管理"></i>
                    <span class="menu-text">评论管理</span></a>
                </li>
                <li><a id="rssList" href="javascript:selectOk('rssList')">
                    <i class="fa fa-fw fa-rss" title="RSS订阅"></i>
                    <span class="menu-text">RSS订阅</span></a>
                </li>
                <li><a id="frendlinkList" href="javascript:selectOk('frendlinkList')">
                    <i class="fa fa-fw fa-link" title="友情连接"></i>
                    <span class="menu-text">友情连接</span></a>
                </li>
                <li><a id="mobanguanli" href="javascript:selectOk('frendlinkList')">
                    <i class="fa fa-th-large fa-lg  fa-fw" title="模板管理"></i>
                    <span class="menu-text">模板管理</span></a>
                </li>
                <li><a id="liuyanguanli" href="javascript:selectOk('catalogList')">
                    <i class="fa fa-fw fa-envelope-o" title="网站留言"></i>
                    <span class="menu-text">网站留言</span></a>
                </li>
            </ul>
            <a href="#userMeun" class="nav-header menu-first collapsed" data-toggle="collapse">
                <i class="fa fa-fw fa-user fa-lg" title="用户管理"></i>
                <span class="menu-text">用户管理</span>
            </a>
            <ul id="userMeun" class="nav nav-list collapse menu-second">
                <li>
                    <a id="usersList" href="javascript:selectOk('usersList')">
                        <i class="fa fa-fw fa-users" title="用户列表"></i>
                        <span class="menu-text">用户列表</span>
                    </a>
                </li>
                <li>
                    <a id="1" href="#">
                        <i class="fa fa-users  fa-fw" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
                <li>
                    <a id="2" href="#">
                        <i class="fa fa-users  fa-fw" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
            </ul>
            <a href="#weChatMenu" class="nav-header menu-first collapsed" data-toggle="collapse">
                <i class="fa fa-fw fa-weixin fa-lg" title="微信管理"></i>
                <span class="menu-text">微信管理</span>
            </a>
            <ul id="weChatMenu" class="nav nav-list collapse menu-second">
                <li>
                    <a id="3" href="#">
                        <i class="fa fa-fw fa-weixin" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
                <li>
                    <a id="4" href="#">
                        <i class="fa fa-fw fa-weixin" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
            </ul>
            <a href="#forumMenu" class="nav-header menu-first collapsed" data-toggle="collapse">
                <i class="fa  fa-fw fa-qq fa-lg" title="论坛管理"></i>
                <span class="menu-text">论坛管理</span>
            </a>
            <ul id="forumMenu" class="nav nav-list collapse menu-second">
                <li>
                    <a id="5" href="#">
                        <i class="fa fa-fw fa-qq" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
                <li>
                    <a id="6" href="#">
                        <i class="fa fa-fw fa-qq" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
            </ul>

            <a href="#shopMenu" class="nav-header menu-first collapsed" data-toggle="collapse">
                <i class="fa fa-fw fa-shopping-cart fa-lg" title="商店管理"></i>
                <span class="menu-text">商店管理</span>
            </a>
            <ul id="shopMenu" class="nav nav-list collapse menu-second">
                <li>
                    <a id="7" href="#">
                        <i class="fa fa-fw fa-shopping-cart" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
                <li>
                    <a id="8" href="#">
                        <i class="fa fa-fw fa-shopping-cart" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
            </ul>
            <a href="#systemMenu" class="nav-header menu-first collapsed" data-toggle="collapse">
                <i class="fa fa-fw fa-cog fa-lg" title="系统管理"></i>
                <span class="menu-text">系统管理</span>
            </a>
            <ul id="systemMenu" class="nav nav-list collapse menu-second">
                <li>
                    <a id="9" href="#">
                        <i class="fa fa-fw fa-cog" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
                <li>
                    <a id="10" href="#">
                        <i class="fa fa-fw fa-cog" title="敬请期待"></i>
                        <span class="menu-text">敬请期待</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <div class="content">
        <ul class="mynavtabs">
        </ul>
        <div class="mytabcontent">
        </div>
    </div>
</div>
<div class="indexfooter">
    <p class="pull-right footercopyright">&copy; 2016 <%=ProjectInfo.getCompanyName() %>
    </p>
    <p class="pull-right footercopyright"><%=userinfo.getNickName()%>
        您好，今天是<%=DateUtil.getDatetimeStr("MM月dd日")%>&nbsp;
        <%=WebUtil.getWeekOfDate() %>&nbsp;<%=tianqi %>。</p>
</div>
</body>
</html>